<?php

session_start();

include_once "src/controller/blmanagement/ReservationManagement.php";
include_once "src/model/Reservation.php";
include_once "src/misc/ClientReponseGenerator.php";

try {

    $reservationId = $_POST["reservationId"];

    $newReservation = new Reservation();
    $newReservation->setReservationID($reservationId);

    if (ReservationManagement::removeReservation($newReservation)) {
        echo ClientReponseGenerator::simpleJsonResponse(1, "", "");
    } else {
        throw new Exception();
    }

} catch (Exception $e) {
    echo ClientReponseGenerator::simpleJsonResponse(0, "DeleteReservationException", "");
}

?>
